// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';
import Login from '../views/Login.vue';
import Register from '../views/Register.vue';
import Question from '../views/Question.vue';
import Study from '../views/Study.vue'; 
import AboutView from '../views/AboutView.vue';
import User from '../views/User.vue';
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/study',
    children: [
      {
        path: '/about',
        name: 'About',
        component: AboutView,
      },
      {
        path: '/login',
        name: 'Login',
        component: Login,
      },
      {
        path: '/register',
        name: 'Register',
        component: Register,
      },
      {
        path: '/question',
        name: 'Question',
        component: Question,
      },
      {
        path: '/study',
        name: 'Study',
        component: Study,
      },

      {
        path: '/user',
        name: 'User',
        component: User,
      }
        ]
  },

];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;